package com.wntms.zjy.service.impl;

import com.github.pagehelper.PageHelper;
import com.wntms.zjy.dao.CustomerComplainDao;
import com.wntms.zjy.pojo.CustomerComplain;
import com.wntms.zjy.service.CustomerComplainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xzbz
 * @create 2022-11-23 11:48
 */
@Service
public class CustomerComplainServiceImpl implements CustomerComplainService {

    @Autowired
    private CustomerComplainDao customerComplainDao;
    @Override
    public boolean deleteComplain(Integer id) {
        return customerComplainDao.deleteComplain(id)==1 ? true:false;
    }

    @Override
    public boolean addComplain(CustomerComplain customerComplain) {
        return customerComplainDao.addComplain(customerComplain) == 1 ? true:false;
    }

    @Override
    public boolean replyComplain(CustomerComplain customerComplain) {
        return customerComplainDao.replyComplain(customerComplain) == 1 ? true:false;
    }

    @Override
    public List<CustomerComplain> findAll() {
        return customerComplainDao.findAll();
    }

    @Override
    public CustomerComplain findByFid(String fid) {
        return customerComplainDao.findByFid(fid);
    }

    @Override
    public List<CustomerComplain> findByPage(Integer currentPage, Integer pageSize) {
        PageHelper.startPage(currentPage,pageSize);

        List<CustomerComplain> customerComplains = customerComplainDao.findAll();
        return customerComplains;
    }
}
